package org.ws.edu.tests;

import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.net.Socket;
import java.net.UnknownHostException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class PerfomansTest {

    public static void main(String[] args) throws UnknownHostException, IOException, ClassNotFoundException {
        List<String[]> list = new ArrayList<String[]>();

        for (int i = 0; i < 1000; i++) {

            Socket socket = new Socket("localhost", 4444);
            ObjectInputStream in = new ObjectInputStream(socket.getInputStream());
            ObjectOutputStream out = new ObjectOutputStream(socket.getOutputStream());

            out.writeInt(1);
            out.flush();

            String[] s = (String[]) in.readObject();
            list.add(s);

        }

        for (int i = 1; i < 1000; i++) {
            System.out.println(Arrays.equals(list.get(0), list.get(i)));
        }

//        for (int k = 0; k < 100; k++) {
//            for (String s : list.get(k)) {
//                System.out.println(s);
//            }
//            System.out.println();
//        }

    }

}
